<?php

 

  $mysql = new mysqli("localhost","root","root","yuedu");

  if($mysql->connect_errno != 0){
    die();
  }

  $y = $_GET["id"]; // 1 == 1   2 == 11  3 == 21   4 == 31
  $num = ($y - 1) * 10 + 1;

  // echo $num;

  if($num == 1){
    $num = 0;
  }


  $sql = "select * from t_articles limit ${num},10";
  $res = $mysql->query($sql);

  // print_r($res);

  for($i = 0; $i < $res->num_rows; $i++){
    $data[] = $res->fetch_assoc();
  }

  print_r(json_encode($data));

?>